package io.bdmc.modules.bss.entity;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.extension.activerecord.Model;
import com.fasterxml.jackson.annotation.JsonFormat;
import io.bdmc.common.annotation.FieldMeta;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors;

import java.io.Serializable;
import java.time.LocalDateTime;
import java.util.List;

/**
 * <p>
 * 机房 实体
 * </p>
 *
 * @author ping
 * @since 2020-06-29
 */
@Data
@EqualsAndHashCode(callSuper = false)
@Accessors(chain = true)
// "DeviceEquipmentroom对象", description = "机房")
public class DeviceEquipmentroom extends Model<DeviceEquipmentroom> {

    private static final long serialVersionUID = 1L;

    // "自增Id")
    @TableId(value = "equipmentroom_id", type = IdType.AUTO)
    private Integer equipmentroomId;

    // "机房名称")
    @FieldMeta(name = "机房名称", description = "机房名称")
    private String equipmentroomName;

    // "机房描述")
    @FieldMeta(name = "机房描述", description = "机房描述")
    private String detail;

    // "机房管理员")
    @FieldMeta(name = "机房管理员", description = "机房管理员")
    private String manager;

    // "机房电话1")
    @FieldMeta(name = "机房电话1", description = "机房电话1")
    private String tel1;

    // "机房电话2")
    @FieldMeta(name = "机房电话2", description = "机房电话2")
    private String tel2;

    // "备注")
    @FieldMeta(name = "备注", description = "备注")
    private String remark;

    // "机房经度")
    @FieldMeta(name = "机房经度", description = "机房经度")
    private String lng;

    // "机房纬度")
    @FieldMeta(name = "机房纬度", description = "机房纬度")
    private String lat;

    // "机房位置")
    @FieldMeta(name = "机房位置", description = "机房位置")
    private String location;

    // "部门id")
    private Long deptId;

    // "创建时间")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
    private LocalDateTime createTime;

    // "创建人")
    private String createBy;

    @TableField(exist = false)
    private List<DeviceFrame> frameList;

    @Override
    public Serializable pkVal() {
        return this.equipmentroomId;
    }

}
